import type { RouteRecordRaw } from 'vue-router'

function Layout() {
  return import('@/layouts/index.vue')
}

const routes: RouteRecordRaw = {
  path: '/collection',
  component: Layout,
  redirect: '/collection/index',
  name: 'collection',
  meta: {
    title: '活动落地页',
    icon: 'tdesign:activity',
  },
  children: [
    {
      path: 'index',
      name: 'collectionIndex',
      component: () => import('@/views/collection/index.vue'),
      meta: {
        title: '活动配置',
      },
    },
    {
      path: 'detail',
      name: 'collectionDetail',
      component: () => import('@/views/collection/detail.vue'),
      meta: {
        title: '活动配置',
        menu: false,
        activeMenu: '/collection/index',
      },
    },
    {
      path: 'categoryDetail',
      name: 'categoryDetail',
      component: () => import('@/views/collection/categoryDetail.vue'),
      meta: {
        title: '分类关联子项配置',
        menu: false,
        activeMenu: '/collection/index',
      },
    },
  ],
}

export default routes
